package com.sjyl.kaoshitong.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.orhanobut.logger.Logger;
import com.sjyl.kaoshitong.R;

/**
 * Created by ChangerLow on 15/4/2.
 * Email: changerlow@qq.com
 */
public class SimpleFragment extends Fragment {
    private static final String TAG = "SimpleFragment";
    private String content;

   /* public static SimpleFragment newInstance(String title){
        SimpleFragment fragment = new SimpleFragment();
        Bundle args = new Bundle();
        args.putString("title",title);
        fragment.setArguments(args);
        return fragment;
    }*/

    public static SimpleFragment newInstance(String title) {
        SimpleFragment fragment = new SimpleFragment();
        Bundle bundle = new Bundle();
        fragment.setArguments(bundle);
        return fragment;
    }

    public SimpleFragment(){}
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //content = getArguments().getString("title");
        Logger.d(TAG, "new fragment instance "+ content);
    }

    @Override
    public View onCreateView(LayoutInflater inflater,  ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_simple_layout, container, false);
        TextView tv = (TextView)rootView.findViewById(R.id.content);
        tv.setText("Page " + content);
        return rootView;
    }
}
